package decorator.children;

import decorator.base.BaseBeverage;
import decorator.base.BaseCondimentDecorator;

/**姚氏调料
 * @author yaojianfeng
 */
public class YaoCoffee extends BaseCondimentDecorator {
    /**
     * 用一个实例变量记录饮料,也就是被继承者
     */
    private BaseBeverage beverage;

    public YaoCoffee(BaseBeverage beverage) {
        this.beverage = beverage;
    }

    /**
     * 获取完整的描述
     *
     * @return 字符串
     */
    @Override
    public String getDescription() {
        return beverage.getDescription() + ",姚氏咖啡";
    }

    /**
     * 计算咖啡的价格
     *
     * @return 价格
     */
    @Override
    public float cost() {
        return 9.99F + beverage.cost();
    }
}
